import javax.swing.*;
import java.util.Scanner;

public class test5 {

        public static void main(String[] args) {
            int number = 123;
            printDigits(number);
        }
        public static void printDigits(int number) {
            // 将整数转换为字符串
            String numberStr = Integer.toString(number);

            for (int i = numberStr.length() - 1; i >= 0; i--) {
                int digit = Character.getNumericValue(numberStr.charAt(i));
                System.out.print(digit + " ");
            }
        }
}
